from fastapi import APIRouter,Depends
from model.equipment_type import EquipmentTypeTable
from sqlalchemy.orm import Session
from db.mysql import get_db
from vendor.extend.courier import *
EquipmentType = APIRouter()

@EquipmentType.get('/pulldown')
async def pulldown(db: Session = Depends(get_db)):
    list_data=db.query(EquipmentTypeTable.id,EquipmentTypeTable.name).all()
    data_list=[]
    for info in list_data:
        data_list.append({
            'id':info.id,
            'name':info.name
        })
    return Success(data=data_list)
